from dotenv import load_dotenv

from config import WORKSPACE_FOLDER, UPLOAD_FOLDER
from models.BaiLian.qwen2vl import Qwen2VL2BInstruct
from pathlib import Path


def recognize(file_name):
    local_path = Path(WORKSPACE_FOLDER, UPLOAD_FOLDER, file_name)
    model = Qwen2VL2BInstruct()
    response = model.call_recognition(local_path=local_path)

    return response

if __name__ == '__main__':
    load_dotenv()
    print(recognize('u28327105392921799fm253fmtautoapp120fJPEG.webp'))
